using System.Collections.ObjectModel;
using Facebook.Core.Responses;

namespace Facebook.Fluent
{
    public class ComparisonOperator<T>
    {
        public FQLQuery Query { get; set; }

        public class Operators
        {
            public const string LT = "<";
            public const string GT = ">";
            public const string EQ = "=";
            public const string LTEQ = "<=";
            public const string GTEQ = ">=";
        }

        public ComparisonOperator(FQLQuery query)
        {
            Query = query;
        }

        public LogicalOperator<T> Eq(object value)
        {
            Query.AddComparison(Operators.EQ,value);
            return new LogicalOperator<T>(Query);
        }

        public LogicalOperator<T> Lt(object value)
        {
            Query.AddComparison(Operators.LT, value);
            return new LogicalOperator<T>(Query);
        }

        public LogicalOperator<T> Gt(object value)
        {
            Query.AddComparison(Operators.GT, value);
            return new LogicalOperator<T>(Query);
        }

        public LogicalOperator<T> LtEq(object value)
        {
            Query.AddComparison(Operators.LTEQ, value);
            return new LogicalOperator<T>(Query);
        }

        public LogicalOperator<T> GtEq(object value)
        {
            Query.AddComparison(Operators.GTEQ, value);
            return new LogicalOperator<T>(Query);
        }

        public LogicalOperator<T> In(LogicalOperator<friend> logicalOperator)
        {
            Query.AddIn(logicalOperator.Query);
            return new LogicalOperator<T>(Query);
        }
    }
}